<?php

namespace common\help;
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class tools
{
    /*
     * 二维数组去重
     */
    public function array_unset_tt($arr,$key){     
        //建立一个目标数组  
        $res = array();        
        foreach ($arr as $value) {           
           //查看有没有重复项  
             
            if(isset($res[$value[$key]])){  
                //有：销毁  
                  
                unset($value[$key]);  
                   
            }else{  

                $res[$value[$key]] = $value;  
            }    
        }  
        return $res;  
    }
}